/*
 * Copyright 2007-2009 Thomas Krause (thomas@berlin-reloaded.de)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.gidoo.cms;

import java.util.LinkedList;
import java.util.List;
import org.gidoo.cms.editor.edit.EditorComponent;
import org.gidoo.cms.editor.edit.SimpleEditorComponent;
import org.gidoo.cms.view.ContentView;
import org.gidoo.cms.view.Preview;

/**
 * Override this class and and {@link GidooCMS#createNewConfiguration() } in order
 * to set some CMS-specific properties.
 * 
 * @see GidooCMS#createNewConfiguration() 
 * @author <a href="mailto:thomas@berlin-reloaded.de">Thomas Krause</a>
 */
public class DefaultConfiguration 
{
  
  /**
   * The path where to mount the CMS part of the application.
   * <br><br>
   * Try to not return an empty path here. gidooCMS will not crash but then
   * really every request will be handled by gidooCMS. Also the one for static
   * resource files.
   *
   * @see GidooCMS#isCMSContent(java.lang.String) 
   * @see #initMountUrls()
   */
  public String getCMSPath()
  {
    return "cms";
  }
  
  /**
   * The path where to mount the editor UI part of the application.
   * @see #initMountUrls()
   */
  public String getCMSEditPath()
  {
    return "edit";
  }
  
  /**
   * The path where to mount the publishing UI part of the application.
   * @see #initMountUrls()
   */
  public String getCMSPublishPath()
  {
    return "publish";
  }
  
  /**
   * The path where to mount the administration UI part of the application.
   * @see #initMountUrls()
   */
  public String getCMSAdminPath()
  {
    return "admin";
  }
  
  /**
   * The page which is used as the view of the CMS.
   */
  public Class<? extends ContentView> getCMSMainPage()
  {
    return ContentView.class;
  }

  /**
   * The page which is used for preview. Normally the easiest way using a
   * sub-lcass of the main page and clearing the rendering pipeling by overriding
   * {@link ContentView#startRenderingPipeline() } with an empty function. See
   * {@link Preview} for an example.
   *
   */
  public Class<? extends ContentView> getCMSPreviewPage()
  {
    return Preview.class;
  }

  /**
   * The editor component that is used at the editor-UI.
   */
  public Class<? extends EditorComponent> getEditorComponent()
  {
    return SimpleEditorComponent.class;
  }
  
  /** Return all addins for the editor UI */
  public List<IEditPlugin> getEditPlugins()
  {
    return new LinkedList<IEditPlugin>();
  }
  
  /** Return all addins for the publisher UI */
  public List<IPlugin> getPublishPlugins()
  {
    return new LinkedList<IPlugin>();
  }
  
  /** Return all addins for the administrator UI */
  public List<IAdminPlugin> getAdminPlugins()
  {
    return new LinkedList<IAdminPlugin>();
  }
  
  
}
